﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Model
{
    [Table("ProcessFlow")]
    public class ProcessFlow
    {
        private int _flowId;
        private int _stationId;
        private string _flowName;
        private string _stepNumber;
        private string _processFlowVersion;
        private string _description;

        // 流程 ID（主键）
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int FlowId
        {
            set { _flowId = value; }
            get { return _flowId; }
        }

        // 工站 ID（外键，非空）
        [Required]
        public int StationId
        {
            set { _stationId = value; }
            get { return _stationId; }
        }

        // 流程名称（非空）
        [Required]
        [StringLength(255)]
        public string FlowName
        {
            set { _flowName = value; }
            get { return _flowName; }
        }

        // 步骤序号（非空，默认 001）
        [Required]
        [StringLength(10)]
        public string StepNumber
        {
            set { _stepNumber = value; }
            get { return _stepNumber; }
        }

        // 工艺流程版本（非空）
        [Required]
        [StringLength(255)]
        public string ProcessFlowVersion
        {
            set { _processFlowVersion = value; }
            get { return _processFlowVersion; }
        }

        // 描述（可空）
        public string Description
        {
            set { _description = value; }
            get { return _description; }
        }

        // 构造函数
        public ProcessFlow()
        {
            StepNumber = "001"; // 默认值
        }
    }
}